package com.sf.fy.uav.common.enums;

/**
 * @author LTQ
 * @version 1.0
 * @description TODO
 * @date 2021-04-13 15:45
 * @since 1.8
 */
public enum ErrandOrderTypeEnum {
    /**
     *
     */
    COLLECTING("揽收", (byte) 1), DELIVERY("派件", (byte) 2);
    private String desc;
    private Byte value;

    public Byte getValue() {
        return value;
    }

    public void setValue(Byte value) {
        this.value = value;
    }

    ErrandOrderTypeEnum(String desc, Byte value) {
        this.desc = desc;
        this.value = value;
    }


    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDesc(Byte value) {
        for (ErrandOrderTypeEnum ele : values()) {
            if (ele.getValue().equals(value)) {
                return ele.getDesc();
            }
        }
        return null;
    }

    public static String getName(Byte value) {
        for (ErrandOrderTypeEnum ele : values()) {
            if (ele.getValue().equals(value)) {
                return ele.name();
            }
        }
        return null;
    }
}
